<script>
if (typeof onDocumentReady === 'undefined') { onDocumentReady = function() {}; }
- if user_is_admin || end_user_analytics
  - if APP_CONFIG.use_google_tag_manager.to_s == "true"
    = render partial: "analytics/google_tag_manager"

  - if APP_CONFIG.use_google_analytics.to_s == "true"
    = render partial: "analytics/legacy_google_analytics"

- if google_analytics_key
  = render partial: "analytics/customer_analytics", locals: {google_analytics_key: google_analytics_key}
</script>
